package app.dev.ems.web.wicket.panel.menu.vertical.home;

import java.io.Serializable;

import org.apache.wicket.Component;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.Link;

import app.dev.ems.web.element.NavigationStatus;
import app.dev.ems.web.wicket.factory.MenuContainerFactory;
import app.dev.ems.web.wicket.factory.NavigationLinkFactory;
import app.dev.ems.web.wicket.panel.menu.vertical.BaseVerticalMenuPanel;

public class HomeVerticalMenuPanel extends BaseVerticalMenuPanel {

	private static final long serialVersionUID = 2325334932396321281L;

	public HomeVerticalMenuPanel(String id) {
		super(id);

		WebMarkupContainer homeContainer = MenuContainerFactory.INSTANCE.getHomeContainer();
		Link<Serializable> home = NavigationLinkFactory.INSTANCE.getUserHomeLink();
		add(homeContainer.add(home));
		getMenuMap().put(NavigationStatus.HOME, new Component[] { homeContainer, home });

		WebMarkupContainer profileViewContainer = MenuContainerFactory.INSTANCE.getProfileViewContainer();
		Link<Serializable> profileView = NavigationLinkFactory.INSTANCE.getProfileViewLink();
		add(profileViewContainer.add(profileView));
		getMenuMap().put(NavigationStatus.PROFILE_VIEW, new Component[] { profileViewContainer, profileView });

		WebMarkupContainer profileEditContainer = MenuContainerFactory.INSTANCE.getProfileEditContainer();
		Link<Serializable> profileEdit = NavigationLinkFactory.INSTANCE.getProfileEditLink();
		add(profileEditContainer.add(profileEdit));
		getMenuMap().put(NavigationStatus.PROFILE_EDIT, new Component[] { profileEditContainer, profileEdit });

		WebMarkupContainer profileSearchContainer = MenuContainerFactory.INSTANCE.getProfileSearchContainer();
		Link<Serializable> profileSearch = NavigationLinkFactory.INSTANCE.getProfileSearchLink();
		add(profileSearchContainer.add(profileSearch));
		getMenuMap().put(NavigationStatus.PROFILE_SEARCH, new Component[] { profileSearchContainer, profileSearch });

		setSelectedLink();
	}
}